const { mysql } = require('../qcloud')

module.exports = async(ctx) => {
    const { pages } = ctx.request.query
    try {
        const hotList = await mysql('tp5_dish').select('*').orderBy('id', 'desc').limit(15).offset(Number(pages) * 15)

        ctx.state.data = {
            hotList
        }
    }catch(e) {
        ctx.state = {
            code: -1,
            data: {
                msg: '添加失败' + e.sqlMessage
            }
        }
    }
}